<%@ page language="java" pageEncoding="UTF-8"%>
<%@taglib prefix="shiro" uri="http://shiro.apache.org/tags" %>
<aside class="main-sidebar">
    <section class="sidebar">
        <ul class="sidebar-menu">
            <shiro:hasRole name="0">
            <li>
                <a href="/main"><i class="fa fa-home"></i> <span> 首页</span></a>
            </li>
            </shiro:hasRole>
            <li class="treeview">
                <a>
                    <i class="fa fa-laptop"></i> <span> 设备管理</span>
                    <span class="pull-right-container"><i class="fa fa-angle-left pull-right"></i></span>
                </a>
                <ul class="treeview-menu">
                        <li><a href="/device/index"><i class="fa fa-circle-o"></i> 设备管理</a></li>
                        <shiro:hasRole name="0">
                        <li><a href="/platform/index"><i class="fa fa-circle-o"></i> 设备平台查询</a></li>
                        </shiro:hasRole>
                    <%--</shiro:hasPermission>--%>
                </ul>
            </li>
            <shiro:hasRole name="0">
            <li class="treeview">
                <a>
                    <i class="fa fa-th"></i> <span> 客户公司中心</span>
                    <span class="pull-right-container"><i class="fa fa-angle-left pull-right"></i></span>
                </a>
                <ul class="treeview-menu">
                    <%--<shiro:hasPermission name="STOCK:QUERY">--%>
                    <li><a href="/company/index"><i class="fa fa-circle-o"></i> 客户管理</a></li>
                    <%--</shiro:hasPermission>--%>
                </ul>
            </li>
            </shiro:hasRole>
                <%--<li class="treeview">--%>
                    <%--<a>--%>
                        <%--<i class="fa fa-th"></i> <span> 区域中心</span>--%>
                        <%--<span class="pull-right-container"><i class="fa fa-angle-left pull-right"></i></span>--%>
                    <%--</a>--%>
                    <%--<ul class="treeview-menu">--%>
                        <%--&lt;%&ndash;<shiro:hasPermission name="STOCK:QUERY">&ndash;%&gt;--%>
                            <%--<li><a href="/area/index"><i class="fa fa-circle-o"></i> 片区管理</a></li>--%>
                            <%--<li><a href="/street/index"><i class="fa fa-circle-o"></i> 街道管理</a></li>--%>
                            <%--<li><a href="/park/index"><i class="fa fa-circle-o"></i> 泊位管理</a></li>--%>
                        <%--&lt;%&ndash;</shiro:hasPermission>&ndash;%&gt;--%>
                    <%--</ul>--%>
                <%--</li>--%>

            <%--</shiro:hasPermission>--%>
            <%--<shiro:hasPermission name="P_EQUIP:QUERY">--%>
                <shiro:hasRole name="0">
                <li class="treeview">
                    <a>
                        <i class="fa fa-tint"></i> <span> 用户中心</span>
                        <span class="pull-right-container"><i class="fa fa-angle-left pull-right"></i></span>
                    </a>
                    <ul class="treeview-menu">
                        <%--<shiro:hasPermission name="EQUIP:QUERY">--%>
                            <li><a href="/user/index"><i class="fa fa-circle-o"></i> 用户管理</a></li>
                            <li><a href="/role/index" ><i class="fa fa-circle-o"></i> 角色管理</a></li>
                        <%--</shiro:hasPermission>--%>
                    </ul>
                </li>
                </shiro:hasRole>
            <%--</shiro:hasPermission>--%>
            <%--<shiro:hasPermission name="P_SETTING:QUERY">--%>
                <shiro:hasRole name="0">
                <li class="treeview">
                    <a>
                        <i class="fa fa-cog"></i> <span> 系统管理</span>
                        <span class="pull-right-container"><i class="fa fa-angle-left pull-right"></i></span>
                    </a>
                    <ul class="treeview-menu">
                        <%--<shiro:hasPermission name="ROLE:QUERY">--%>

                        <%--</shiro:hasPermission>--%>
                        <%--<shiro:hasPermission name="LOG:QUERY">--%>
                            <li><a href="/log"><i class="fa fa-circle-o"></i> 系统日志</a></li>
                        <%--</shiro:hasPermission>--%>
                    </ul>
                </li>
                </shiro:hasRole>
            <%--</shiro:hasPermission>--%>
        </ul>
    </section>
</aside>
<script  type="text/javascript">
    var url = '${url}';
    if(url != null){
        //激活点击的菜单
        var li = $(".sidebar").find("a[href = '" + url + "']").parent();
        li.addClass("active");

        //open 菜单
        var ul = li.parent().parent();
        if(ul.hasClass("treeview")){
            ul.addClass("active");
        }
    }
</script>